    
    
const readline = require('readline');
const fs = require('fs');
var regex = /\[(\d{2})\:(\d{2})\.(\d{2})\]\s(.+)/;

var StreamReader = fs.createReadStream('test333')
StreamReader.on('data',(chunk)=>{
    //chunk只是文档的一个片段  不完整
    data += chunk.toString();
})

StreamReader.on('end',()=>{
    //通知你已经结束了此时data是完整的
    console.log(data);
})

//====================================================

var rl = readline.createInterface({input:streamReader});
var begin = new Date().getTime();
rl.on('line',(line)=>{
    task(line);
})


function task(line){
    var matches = regex.exec(line);
        if(matches){
            var m = parseInt(matches[1]);
            var s = parseInt(matches[2]);
            var f = parseInt(matches[3]);
            var lyric = matches[4];
            console.log(m);
            console.log(s);
            console.log(f);
            console.log(lyric);
        }else{
           console.log(line); 
        }
}